load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "scdecomp",
    srcs = [
        "decomp.go",
        "dependencies.go",
        "helpers.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scdecomp",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/geo/geopb",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/schemaexpr",
        "//pkg/sql/catalog/seqexpr",
        "//pkg/sql/catalog/typedesc",
        "//pkg/sql/parser",
        "//pkg/sql/schemachanger/scerrors",
        "//pkg/sql/schemachanger/scpb",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sem/catid",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/util/iterutil",
        "//pkg/util/protoutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_lib_pq//oid",
    ],
)

go_test(
    name = "scdecomp_test",
    srcs = [
        "decomp_test.go",
        "main_test.go",
    ],
    data = glob(["testdata/**"]),
    deps = [
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/sql/schemachanger/sctest",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/serverutils",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
    ],
)
